/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.distribution.comment.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yami.shop.distribution.comment.vo.DistributionUserVO;
import com.yami.shop.bean.vo.SysUserVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;

/**
 * 分销员钱包流水
 *
 * @author xwc
 * @date 2019-04-29 16:39:13
 */
@Data
@TableName("yy_distribution_user_wallet_bill")
@EqualsAndHashCode
public class DistributionUserWalletBill implements Serializable{
    private static final long serialVersionUID = 1L;

    public DistributionUserWalletBill(){

    }


    /**
     *
     * @param distributionUserWallet 变更后的钱包对象
     * @param remarks
     */
    public DistributionUserWalletBill(DistributionUserWallet distributionUserWallet,
                                      String remarks,
                                      Double unsettledAmount,
                                      Double settledAmount,
                                      Double invalidAmount,
                                      Double addupAmount,
                                      Integer type
    ){
        this.remarks=remarks;
        this.unsettledAmount=unsettledAmount;
        this.settledAmount=settledAmount;
        this.invalidAmount=invalidAmount;
        this.addupAmount=addupAmount;
        this.type=type;
        this.createTime=new Date();
        this.walletId=distributionUserWallet.getWalletId();
        this.unsettledAmountAfter=distributionUserWallet.getUnsettledAmount();
        this.settledAmountAfter=distributionUserWallet.getSettledAmount();
        this.invalidAmountAfter=distributionUserWallet.getInvalidAmount();
        this.addupAmountAfter=distributionUserWallet.getAddupAmount();
    }


    /**
     * 钱包流水记录
     */
    @TableId
    private Long id;
    /**
     * 钱包id
     */
    private Long walletId;
    /**
     * 待结算金额变更数额
     */
    private Double unsettledAmount;
    /**
     * 可提现金额变更数额
     */
    private Double settledAmount;
    /**
     * 失效金额变更数额
     */
    private Double invalidAmount;
    /**
     * 积累收益变更数额
     */
    private Double addupAmount;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 备注
     */
    private String remarks;

    /**
     * 变更后待结算金额
     */
    private Double unsettledAmountAfter;

    /**
     * 变更后可提现金额
     */
    private Double settledAmountAfter;

    /**
     * 变更后失效金额
     */
    private Double invalidAmountAfter;

    /**
     * 变更后积累收益
     */
    private Double addupAmountAfter;

    /**
     * 类型(0 系统修改 1人工修改)
     */
    private Integer type;

    /**
     * 操作人id(空为系统)
     */
    private Long modifier;

    /**
     * 关联分销员
     */
    @TableField(exist=false)
    private DistributionUserVO distributionUser;

    /**
     * 关联操作人
     */
    @TableField(exist=false)
    private SysUserVO sysUser;

}
